import BaseModel from './baseModel'
import { Api } from '@ajax/api'
import { dataFormat } from '@utils/time'
import { CATCH_KEY_STUDY_TIME_LINE_LIST } from './cacheKey'

export default class TimeLineModel extends BaseModel {

  // 加载全部的URL
  static loadAllApi = Api.studyTimeLine.all
  // 所有数据缓存的KEY
  static LOAD_ALL_CACHE_KEY = CATCH_KEY_STUDY_TIME_LINE_LIST

  // 标题
  title!: string
  // 时间
  date!: Date
  // 内容
  content!: string
}

// 时间字符串
export function dateStr(model: TimeLineModel) {
  return dataFormat(model.date)
}